//
//  CZTempViewController.swift
//  CZVVeiBo
//
//  Created by smile on 2017/7/29.
//  Copyright © 2017年 itcast. All rights reserved.
//

import UIKit

class CZTempViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        setupUI()
    }
    
    // MARK: - 设置视图
    private func setupUI(){
        view.backgroundColor = UIColor.white
        setupNav()
    }
    
    // MARK: - 设置导航
    private func setupNav(){
    
//        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "首页", imgName: "navigationbar_back_withtext", target: self, action: #selector(leftClick))
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "PUSH", imgName: nil, target: self, action: #selector(rightClick))
        
        // title
        navigationItem.title = "第\(navigationController?.viewControllers.count ?? 0)个控制器"
    }
    
    func leftClick(){
        _ = navigationController?.popViewController(animated: true)
    }
    
    func rightClick(){
        let tempVc = CZTempViewController()
        navigationController?.pushViewController(tempVc, animated: true)
    }

}
